﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SocialFront.Entities;
using SocialFront.Providers.Avatar;
using SocialFront.Providers.Member;
using SocialFront.Providers.Relationship;

namespace SocialFront.Web.usercontrols.Membership
{
    public partial class MembershipDetails : System.Web.UI.UserControl
    {
        public Avatar Avatar { get; set; }
        public Member Member { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            IList<Member> members = RelationshipProvider.Provider.GetMemberRelatedToCurrentNode();
            Member = members[0];
            Avatar = AvatarProvider.Provider.GetAvatar(members[0]);
            if (Avatar == null)
            {
                throw new ArgumentNullException("Avatar", "Avatar returned is Null.");
            }
        }
    }
}